asm.txt›-------›› Assembly language runs about 10›times faster than ACE C and takes up›about a third of the space. ACE C›provides the ability to define a›function as an assembly language›routine via the asm statement. To›define the function use:› func() $(› asm address-of-function;› Note that asm acts like a›closing brace, signaling the end of›the function. You need not include›any arguments in func(). Any›arguments between the parenthesis›will be placed on a stack in the›order that they occur. When your›routine gets control, the pointer to›the stack will be at $C6, and the›number of arguments passed will be›in $BF. To get the low byte of an›arguement use:› LDY #argumentnumber*2› LDA ($C6),Y›To get the high byte, use LDY›#arguementnumber*2+1.› If you want to return an›integer, load A with the low byte,›and X with the high byte. To return›a character, load A with the›character, and X with a zero. End›your code with an RTS.› The page zero locations which›are free are $80 through $B5, and›$C8 through $CF. ACE C uses the›Operating System's floating point›registers, so though you may use›them, don't leave a value in them›expecting it to be there the next›time your routine is called. Two›additional locations that may be of›value to you are $B7 - color from›color(c), and $B6 the graphics in›559 before fast() was used.› ENGINE.OBJ starts at $2C00, so›you may use memory from LOMEM ›(value in $2E7) up to that. Also›$400-$57F, and $600-$6FF is free. ›($400-47F is the cassette buffer). ›LINK will tell you where the stack›starts, so you could figure out a›safe place well above that.› Assemble your program with the›extension ".OBJ". Be sure to›include it in the ".LNK" file with›the extension ".OBJ". The order it›appears is not relevant. Note that›both ENGINE.OBJ and ENGLOAD.OBJ use›the load/run address at $2E0.›››